package com.aaa.controller;

import com.aaa.entity.MyReturn;
import com.aaa.entity.ViewTestResultSas;
import com.aaa.service.ViewTestResultSasService;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
* @Author: WTH
* @Description: 饼状图
* @Date:2022-07-09 08:20
* @Params:  * @param null
* @return: 
*/
@Controller
@RequestMapping("tblTesterSas")
public class ViewTestResultSasController extends BaseController{
    MyReturn myReturn = new MyReturn();
    @Autowired
    private ViewTestResultSasService viewTestResultSasService;
    @RequestMapping("testerSas.do")
    private String Pages() {
        return "testerSAS";
    }
    /**
     *
     * @param viewTestResultSas
     * @return MyReturn
     *  查询  模糊查询
     */
    @ResponseBody
    @RequestMapping("selectTblTesterSas.do")
    public MyReturn selectTblTesterSas(ViewTestResultSas viewTestResultSas){
        System.out.println(viewTestResultSas);
        Page page = viewTestResultSasService.selectResultSas(viewTestResultSas);
        //获取查询结果
        myReturn.setData(page.getResult());
        //获取总条数
        myReturn.setCount(page.getTotal());
        return super.getSuccessResult(myReturn);
    }
    /*
     * 焦虑程度测试
     * */

    @RequestMapping("seleSasCount.do")
    @ResponseBody
    public MyReturn seleSasCount(){
        Map<String, Integer> map = viewTestResultSasService.seleTeseSasUser();
        myReturn.setData(map);
        return super.getSuccessResult(myReturn);
    }
    @RequestMapping("testerFormSas.do")
    private String Page() {
        return "reportFormsSas";
    }

}
